<tagLib name="html" />
<include file="Public:header" />
<script src="/Public/source/jquery.js"></script>
<script>
	$(function(){
		$(".display").mouseover(function(){
			$(this).css('background','#D3DCE3');
		}).mouseout(function(){
			$(this).css('background','#F4F8FC');
		});
	});
</script>
	<div style="width:100%; height:15px;color:#000;margin:0px 0px 10px;">
	  <div style="float:left;"><a href="{YICMS::U('Index/stat')}" target="main"><b>控制面板首页</b></a>&nbsp;&raquo;&nbsp;内容分类&nbsp;&raquo;&nbsp;<a href="{YICMS::U('Newssort/add')}" style="color:red;font-weight:bold;">添加新分类</a></div>
	</div>
	<table cellspacing="1" cellpadding="4" width="100%" align="center" style="border: 0 none !important; border-collapse: separate !important;empty-cells: show;margin-bottom: 0px;">
		<tr class="header" align="center">
			<td width="10%" class="center">分类ID</td>
			<td width="45%" class="center">分类名称</td>
			<td  width="5%" class="center">排序</td>
			<td  width="5%" class="center">编辑</td>
			<td  width="5%" class="center">删除</td>
			<td  width="10%" class="center">隐藏导航</td>
		</tr>
	</table>
	<ul id="list">
		<if condition="$list neq NULL">
			
				<li style="list-style:none;border-bottom:1px dotted #BCBCBC" >
					<table  id="table1" cellspacing="1" cellpadding="4" width="100%" align="center" style="border: 0 none !important; border-collapse: separate !important;empty-cells: show;margin-bottom: 0px;"> 
					<volist name="list" id="vo">
						<tr align="center" class="smalltxt display" id="pid-{YICMS:$vo.pid}">
							<td width="10%" class="center">{YICMS:$vo.id}</td>
							<td width="45%" id="lishow" onclick="asd({YICMS:$vo.id})">
								<eq name="vo.pid" value="0">
								<img src="../Public/Images/tv-expandable.gif" id="p{YICMS:$vo.id}" url='1' />
								<else />
								<img src="../Public/Images/tv-item.gif"/>
								</eq>
								{YICMS:$vo.name} <a style="text-decoration:underline" href="{YICMS::U('Newslist/index?pid='.$vo['id'])}"><font color="red">[查看内容]</font></a>
							</td>
							<td width="5%" class="center">{YICMS:$vo.taxis}</td>
							<td width="5%" class="center"><a href="{YICMS::U('Newssort/edit?id='.$vo['id'])}" style="background:url(../Public/Images/admin/edit.png) no-repeat center center;padding:0px 20px;">&nbsp;</a></td>
							<td width="5%" class="center"><a href="{YICMS::U('Newssort/del?id='.$vo['id'])}" onclick="return confirm('提示：您确定要删除该分类吗？不可恢复！建议隐藏该分类,而不是删除!')" style="background:url(../Public/Images/admin/remove.png) no-repeat center center;padding:0px 20px;">&nbsp;</a></td>
							<td width="10%" class="center">
								<if condition="$vo.state eq 0">
									<a href="{YICMS::U('Newssort/stop?id='.$vo['id'].'&state=1')}" onclick="return confirm('提示：您确定要隐藏该分类吗?即网站前台不显示!')" style="color:red">点击隐藏</a>
								<else />
									<a href="{YICMS::U('Newssort/stop?id='.$vo['id'].'&state=0')}" onclick="return confirm('提示：您确定要显示该分类吗?即网站前台显示!')" style="color:red">点击显示</a>
								</if>
							</td>
						</tr>
						</volist>
					</table>
				</li>
			
		<else />
			<li>
				<table  id="table1" cellspacing="1" cellpadding="4" width="100%" align="center" style="border: 0 none !important; border-collapse: separate !important;empty-cells: show;margin-bottom: 0px;"> 
					<tr align="center" class="smalltxt">
						<td class="altbg1" style="text-align:center;font-weight:bold;color:#E01558;padding:10px 0px;">暂时没有分类!请点击上面的添加按钮添加!^_^</td>
					</tr>
				</table>
			</li>
		</if>	
	</ul>
<br/>
<script>
$(function(){
	$('#pid-0').show();
	for(var i=1;i<100;i++){
		$('[id=pid-'+i+']').hide();
	}
});
function asd(p){
	var state=$("#p"+p+"").attr('url');
	
	if(state=='1'){
		$('[id=pid-'+p+']').show();
		$("#p"+p+"").attr('url','0');
		$("#p"+p+"").attr('src','../Public/Images/tv-collapsable.gif')
	}else{
		$("#p"+p+"").attr('url','1');
		$('[id=pid-'+p+']').hide();
		$("#p"+p+"").attr('src','../Public/Images/tv-expandable.gif')
	}
}
</script>
<include file="Public:footer" />